﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ExportToRTR.CApExportToRTRSafetyController
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll


namespace DnProcessSimulateCommands.ExportToRTR{

internal class CApExportToRTRSafetyController : ICApExportToRTRWriteable
{
  public double m_softLowerLimit;
  public double m_softUpperLimit;
  public double m_kPosition;
  public double m_kVelocity;

  public CApExportToRTRSafetyController(
    double softLowerLimit,
    double softUpperLimit,
    double kPosition,
    double kVelocity)
  {
    this.m_softLowerLimit = softLowerLimit;
    this.m_softUpperLimit = softUpperLimit;
    this.m_kPosition = kPosition;
    this.m_kVelocity = kVelocity;
  }

  public void Write(CApExportToRTRXmlWriter writer)
  {
    writer.WriteStartElement("safetyController");
    if (this.m_softLowerLimit != 0.0)
      writer.WriteAttributeString("soft_lower_limit", this.m_softLowerLimit.ToString() ?? "");
    if (this.m_softUpperLimit != 0.0)
      writer.WriteAttributeString("soft_upper_limit", this.m_softUpperLimit.ToString() ?? "");
    if (this.m_kPosition != 0.0)
      writer.WriteAttributeString("k_position", this.m_kPosition.ToString() ?? "");
    writer.WriteAttributeString("k_velocity", this.m_kVelocity.ToString() ?? "");
    writer.WriteEndElement();
  }
}
